package com.grass.p019lv.adapter;

import android.text.TextUtils;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.androidsa.bttsddka.R;
import com.androidx.p013lv.base.glide.GlideUtils;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.base.utils.TimeUtils;
import com.androidx.p013lv.base.view.CircleImageView;
import com.grass.p019lv.bean.DynamicComment;

/* renamed from: com.grass.lv.adapter.ReplyCommentAdapter */
public class ReplyCommentAdapter extends BaseRecyclerAdapter<DynamicComment, ViewHolder> {
    private String domain;

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(ViewHolder viewHolder, int i) {
        viewHolder.setData((DynamicComment) getDataInPosition(i));
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
        return new ViewHolder(LayoutInflater.from(viewGroup.getContext()).inflate(R.layout.item_comment_message, viewGroup, false));
    }

    /* renamed from: com.grass.lv.adapter.ReplyCommentAdapter$ViewHolder */
    public class ViewHolder extends BaseRecyclerHolder {
        CircleImageView img_user_head;
        ImageView iv_cover;
        TextView tv_content;
        TextView tv_nick_name;
        TextView tv_time;
        TextView tv_type;

        ViewHolder(View view) {
            super(view);
            this.img_user_head = (CircleImageView) view.findViewById(R.id.img_user_head);
            this.tv_nick_name = (TextView) view.findViewById(R.id.tv_nick_name);
            this.tv_type = (TextView) view.findViewById(R.id.tv_type);
            this.tv_content = (TextView) view.findViewById(R.id.tv_content);
            this.tv_time = (TextView) view.findViewById(R.id.tv_time);
            this.iv_cover = (ImageView) view.findViewById(R.id.iv_cover);
        }

        /* access modifiers changed from: package-private */
        public void setData(DynamicComment dynamicComment) {
            if (dynamicComment.getType() == 1) {
                this.tv_type.setText("評論了妳的動態");
            } else {
                this.tv_type.setText("回復了妳的評論");
            }
            if (TextUtils.isEmpty(dynamicComment.getLogo())) {
                GlideUtils.loadPicHeadDefault(this.img_user_head);
            } else {
                GlideUtils.loadPicHead(ReplyCommentAdapter.this.domain + dynamicComment.getLogo(), this.img_user_head);
            }
            this.tv_nick_name.setText(dynamicComment.getNickName());
            this.tv_time.setText(TimeUtils.utc2Common(dynamicComment.getCreatedAt()));
            this.tv_content.setText(dynamicComment.getContent());
            if (TextUtils.isEmpty(dynamicComment.getCoverImg())) {
                GlideUtils.loadResId(R.drawable.base_ic_default_cover, this.iv_cover);
                return;
            }
            GlideUtils.loadPic(ReplyCommentAdapter.this.domain + dynamicComment.getCoverImg(), this.iv_cover);
        }
    }
}
